<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 *留言记录
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'edit';
if($_RQ['op']=='edit'){
	$year=date('Y');
	$year=intval($year);
	$daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
	$id=intval($_RQ['id']);
	$mid=intval($_RQ['mid']);
	if($id){
		$item=pdo_get('jy_51job_jianli',array('id'=>$id,'uniacid'=>$_SESSION['uniacid']));
	}elseif($mid){
		$item=pdo_get('jy_51job_jianli',array('mid'=>$mid,'uniacid'=>$_SESSION['uniacid']),'','id desc');
	}
	$item['gonginfo']=$item['gonginfo']?json_decode($item['gonginfo'],true):array();
	$item['xueinfo']=$item['xueinfo']?json_decode($item['xueinfo'],true):array();
	$item['xianginfo']=$item['xianginfo']?json_decode($item['xianginfo'],true):array();
	$item['peiinfo']=$item['peiinfo']?json_decode($item['peiinfo'],true):array();
	$item['pcd']=json_decode($item['pcd'],true);
	$item['member']=pdo_get('jy_51job_member',array('id'=>$_SESSION['memberid'],'uniacid'=>$_SESSION['uniacid']));
	if($item['createtime']>$daytime-2*24*3600){
		$item['isnew']=1;
	}
	if(!$item['isnew'] && $item['member']['logintime']>$daytime){
		$item['isday']=1;
	}
	$item['member']['birth']=$item['age']?:$item['member']['birth'];
	$item['age2']=$item['member']['birth'];
	$item['age']=$item['member']['birth']>0?$year-intval($item['member']['birth']):'';
	$item['typetitle']=$this->job_type[$item['type']];
	$item['xuelititle']=$this->xueli_type[$item['xueli']];
	if($item['type']){
		$item['gongzhititle']=$this->xinzhis2[$item['gongzhi']].'/天';
	}else{
		$item['gongzhititle']=$this->xinzhis[$item['gongzhi']].'/月';
	}
	$item['sextitle']=$this->sex[$item['sex']];
	$item['createtime']=date('Y-m-d H:m:s',$item['createtime']);
	$item['cids']=str_array($item['cids']);
	$item['cidstitle']=array();
	foreach($item['cids'] as $cid){
		$item['cidstitle'][]=pdo_getcolumn('jy_51job_job_group',array('id'=>$cid,'uniacid'=>$_SESSION['uniacid']),'title');
	}
	$item['mobile2']=$item['member']['mobile'];
	$item['mobile2']=substr($item['mobile2'],0,3).'****'.substr($item['mobile2'],0,4);
	$return['nolook']=$this->model('merch')->jianlilook();
	$insert=array(
		'memberid'=>$_SESSION['memberid'],
		'merchid'=>$_SESSION['merchid'],
		'jianliid'=>$item['id'],
	);
	$jianli_log=pdo_get('jy_51job_jianli_log',$insert);
	if($jianli_log['id']){
		$return['islook']=1;
	}
	$return['item']=$item;
	set_html('title','简历详情');
	exi($return);
}
if($_RQ['op']=='lookjianli'){
	$postdata=get_postdata();
	$id=$_RQ['id'];
	$insert=array(
		'memberid'=>$_SESSION['memberid'],
		'merchid'=>$_SESSION['merchid'],
		'jianliid'=>$id,
	);
	$jianli_log=pdo_get('jy_51job_jianli_log',$insert);
	if($jianli_log['id']){
		
	}else{
		$this->model('merch')->jianlilook($_SESSION['merchid'],1);
		$insert['uniacid']=$_SESSION['uniacid'];
		$insert['islook']=1;
		$insert['createtime']=TIMESTAMP;
		pdo_insert('jy_51job_jianli_log',$insert);
	}
	exi($insert);
}